<template>
	<div class="page flex-col">
		<div class="group_14 flex-col">
			<text class="text_38">
				本测评大约耗时9分钟，快速评估您是否患有轻度认知障碍、痴呆等风险，并提供针对性的脑健康指导建议
			</text>
			<div class="block_12 flex-col">

			</div>
			<button v-if="!token" style="align-items:flex-start;padding-left: 0;" class="kf_button"
				open-type="getPhoneNumber" @getphonenumber="handleCheck">
				<div class="text-wrapper_10 flex-col">
					<text class="text_37">开始筛查</text>
				</div>
			</button>
			<div v-else class="text-wrapper_10 flex-col" @click="handleCheck({})">
				<text class="text_37">开始筛查</text>
			</div>

			<div class="text-wrapper_11 flex-col">
				<text class="text_39">认知风险筛查简介</text>
			</div>
		</div>
		<div class="group_3 flex-col">
			<div class="block_1 flex-col">
				<div class="block_18 flex-col">
					<div class="box_28 flex-col">
						<div class="section_14 flex-col"></div>
						<div class="text-group_13 flex-col">
							<text class="paragraph_1">
								国家卫生健康委办公厅关于开展抑郁症
								<br />
								老年痴呆防治特色服务工作的通知
							</text>
							<text class="text_40">国卫办疾控函[2020]726号</text>
						</div>
					</div>
				</div>
				<div class="block_20 flex-row justify-between">
					<div class="image-text_25 flex-row justify-between">
						<div class="section_1 flex-col"></div>
						<div class="text-group_14 flex-col">
							<text class="text-group_1">加强科普宣传</text>
							<div class="text-wrapper_2">
								<text class="text_5">老年痴呆防治知识知晓率提高至</text>
								<text class="text_6">80%</text>
							</div>
						</div>
					</div>
					<div class="image-text_26 flex-row justify-between">
						<div class="block_2 flex-col"></div>
						<div class="text-group_15 flex-col">
							<text class="text-group_2">普及评估筛查</text>
							<div class="text-wrapper_3">
								<text class="text_7">社区（村）65岁以上筛查率达</text>
								<text class="text_8">80%</text>
							</div>
						</div>
					</div>
				</div>
				<div class="block_21 flex-row justify-between">
					<div class="image-text_27 flex-row justify-between">
						<div class="block_3 flex-col"></div>
						<div class="text-group_16 flex-col">
							<text class="text-group_3">开展预防干预</text>
							<div class="text-wrapper_4">
								<text class="text_9">医联体组织常态</text>
								<text class="text_10">认知训练</text>
								<text class="text_11">与药物干预指导</text>
							</div>
						</div>
					</div>

					<div class="image-text_28 flex-row justify-between">
						<div class="group_4 flex-col"></div>
						<div class="text-group_17 flex-col">
							<text class="text-group_4">建设协作团队</text>
							<div class="text-wrapper_5">
								<text class="text_12">县级以上医院开设</text>
								<text class="text_13">记忆门诊</text>
								<text class="text_14">定期技能培训</text>
							</div>
						</div>
					</div>
				</div>

				<div class="block_19 flex-col"></div>
				<div class="text-wrapper_1">
					<text class="text_2">爱脑行动公益项目，为响应“</text>
					<text class="text_3">国家老年痴呆防治工作</text>
					<text class="text_4">
						”的号召要求，以公益的方式提供免费认知障碍风险筛查，从而预防和减缓老年痴呆的发生，降低家庭与社会负担，提高家庭幸福感，促进社会和谐稳定。
					</text>
				</div>
			</div>
		</div>
		<div class="group_5 flex-col">
			<div class="group_26 flex-row justify-between">
				<div class="group_6 flex-col"></div>
				<text class="text_15">筛查工具特特点</text>
			</div>
			<text class="text_16">
				本筛查工具基于北京师范大学认知神经科学与学习国家重点实验室十余年的理论体系构建和应用技术研发，具备便利性、权威性、有效性和专业性等特点。
			</text>
			<div class="text-wrapper_12 flex-row justify-between">
				<img src="https://www.ainaoxingdong.com/api/an-media/images/an/static/middleBg2.png" alt=""
					style="width: 100%;height: 100%;">
			</div>
		</div>
		<div class="group_10 flex-col">
			<div class="box_35 flex-row justify-between">
				<div class="box_7 flex-col"></div>
				<text class="text_30">产品专业资质</text>
			</div>
			<div class="box_36 flex-row justify-between">
				<div class="box_37 flex-col">
					<div class="block_22 flex-row justify-between">
						<div class="box_9 flex-col"></div>
						<text class="text_31">学术成果</text>
					</div>
					<text class="text_32">
						多篇学术成果已发表，工具的测算过程及判别效果被国外同行专家认可与使用。
					</text>
				</div>
				<div class="image_1 flex-col">
					<img src="https://www.ainaoxingdong.com/api/an-media/images/an/static/middleScreening/1.png" alt=""
						style="width: 100%;height: 100%;">
				</div>
			</div>
			<div class="box_38 flex-row justify-between">
				<div class="box_39 flex-col">
					<div class="box_40 flex-row justify-between">
						<div class="box_13 flex-col"></div>
						<text class="text_33">专家共识</text>
					</div>
					<text class="text_34">
						电子化测评工具与临床应用获得百余位行业专家一致共识，五大学会联合推荐。
					</text>
				</div>
				<div class="image_2 flex-col">
					<img src="https://www.ainaoxingdong.com/api/an-media/images/an/static/middleScreening/2.png" alt=""
						style="width: 100%;height: 100%;">
				</div>
			</div>
			<div class="box_41 flex-row justify-between">
				<div class="group_31 flex-col">
					<div class="box_42 flex-row justify-between">
						<div class="group_12 flex-col"></div>
						<text class="text_35">软著专利</text>
					</div>
					<text class="text_36">脑认知功能测评系统26项</text>
				</div>
				<div class="image_3 flex-col">

					<img src="https://www.ainaoxingdong.com/api/an-media/images/an/static/middleScreening/3.png" alt=""
						style="width: 100%;height: 100%;">
				</div>
			</div>
		</div>

		<!-- <tabBar></tabBar> -->
		<u-toast ref="uToast"></u-toast>
	</div>
</template>
<script>
	import {
		login
	} from "@/api/api.js";
	import {
		mapState
	} from "vuex";
	export default {
		data() {
			return {
				constants: {},
				code: ''
			};
		},
		computed: {
			...mapState({
				token: (state) => state.token,
			}),
		},
		methods: {
			// handleStart() {
			//   // console.log(123456)
			//   uni.navigateTo({
			//     url: "/pages/middleScreening/screening/screening",
			//   });
			// },
			redict() {
				uni.navigateTo({
					url: "/pages/middleScreening/screening/screening",
				});
			},
			handleCheck(e) {
				if (this.token) {
					this.redict();
				} else {
					// uni.navigateTo({
					// 	url: '/pages/personal/login/login'
					// })
					const _this = this
					if (!e.detail.iv) {
						return
					}
					//发起网络请求
					login({
						encryptedData: e.detail.encryptedData,
						iv: e.detail.iv,
						code: this.code,
						promotionCode: this.$store.state.promotionCode,
					}).then(
						(res) => {
							_this.$refs.uToast.show({
								type: "success",
								message: res.msg,
							});
							// 设置vuex 和 本地缓存
							uni.setStorageSync("token", res.token);
							_this.$store.commit("set_token", res.token);
							_this.$store.dispatch('checkUser')
						},
						(err) => {
							_this.$refs.uToast.show({
								type: "error",
								message: err.msg,
							});
							_this.$store.dispatch("clearStorage");
						}
					);
				}
			},
			getCode() {
				//
				const _this = this
				wx.login({
					success(res) {
						if (res.code) {
							_this.code = res.code
						} else {
							console.log("获取微信code失败！" + res.errMsg);
						}
					},
					fail(err) {
						console.log(err, "errerr");
					},
				});
			}
		},
		onLoad() {
			uni.hideTabBar();
		},
		onShow() {
			this.$store.dispatch('checkUser')
			this.getCode()
		}
	};
</script>
<style>
	@import "./common.css";
	@import "./index.rpx.css";

	.kf_button {

		background-color: rgba(255, 255, 255, 0);
		border: 0px;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		// height: 100rpx;
	}

	.kf_button::after {
		border: 0px;
	}
</style>
